<html>
  <head>
    <title>Other Inputs</title>
    <link rel="Stylesheet" type="text/css" href="jquery.validity.css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="jquery.validity.js"></script>
    <script type="text/javascript">
      $.validity.setup({ outputMode:"summary" });
      
      $(function() { 
        $("form").validity(function() { 
          
          if ($("input[name='group1']:checked").val() == "Milk")
            $("input[name='group2']:checked")
              .assert($("input[name='group2']:checked").val() != "Wine", "You can't have milk with wine, that's weird.");
            
          if ($("#maillist").attr("checked")){
            $("#email")
              .require("We're gonna need your email to send you updates")
              .match("email");
          }
        
        });
      });
    </script>
  </head>
  <body>
    <form action="otherinputs.htm" method="get">
      <table>
        <tr>
          <td>
            <input type="radio" name="group1" value="Milk"> Milk <br />
            <input type="radio" name="group1" value="Butter" checked> Butter <br />
            <input type="radio" name="group1" value="Cheese"> Cheese <br />
          </td>
          <td>
            <input type="radio" name="group2" value="Water"> Water <br />
            <input type="radio" name="group2" value="Beer"> Beer <br />
            <input type="radio" name="group2" value="Wine" checked> Wine <br />
          </td>
        </tr>
      </table>
      <hr />
      <input type="checkbox" id="maillist" name="maillist" />Yes, I'd like to recieve updates: <br />
      My email:<input type="text" id="email" name="email" />
      <hr />
      <input type="submit" />
    </form>
    <div id="validity-summary-container">
      The form didn't submit because of the following reason(s):
      <ul id="validity-summary-output"></ul>
    </div>
  </body>
</html>
